package com.googlecode.garbagecan.dbtest.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DBUtil {
	public static String getSingleValue(Connection conn, String sql) throws SQLException {
		PreparedStatement ps = conn.prepareStatement(sql);
		ResultSet rs = ps.executeQuery();
		String value = null;
		while (rs.next()) {
			value = rs.getString(1);
		}
		rs.close();
		ps.close();
		
		return value;
	}
}
